import React from 'react'

// 1.安装：npm add react-router-dom
// 2.导入路由：Router / Route / Link
// 3.创建页面 接着使用route组件配置
import { BrowserRouter as Router, Route, Redirect } from 'react-router-dom'
import Home from './pages/Home'
import CityList from './pages/CityList'
import Search from './pages/Search'
import Map from './pages/Map'

// 导入组件
// import {Button} from 'antd-mobile'

function App() {
  return (
    <Router>
      <div className="App">
        {/* 默认路由匹配时，跳转到 /home 实现路由重定向到首页 */}
        <Route path="/" exact render={() => <Redirect to="/home" />} />
        <Route path="/home" component={Home} />
        <Route path="/cityList" component={CityList} />
        <Route path="/search" component={Search} />
        <Route path="/map" component={Map} />
      </div>
    </Router>
  )
}

export default App
